<!-- 搜索表单 -->
<style lang="less">
    .panel-border {
        padding-bottom: 0;
    }

    .el-row {

    }

    .el-form--inline .el-form-item__content {
        width: 100%;
    }
</style>
<template>
  <div class="ces-search">
    <el-form v-for="item in searchForm" :size="size" inline>
      <el-form-item :key="item.prop" :label="item.label" :style="[{'margin-left':'20px'},{'border':((item.type==='Input')?'1px solid #e1e3e5':'none')}]">
        <!-- 输入框 -->
        <el-input v-if="item.type==='Input'" v-model="searchData[item.prop]" size="mini" :placeholder="item.placeholder" />
        <!-- 下拉框 -->
        <el-select v-if="item.type==='Select'" v-model="searchData[item.prop]" size="mini">
          <el-option v-for="op in item.datas" :key="op.item_code" :label="op.item_text" :value="op.item_code" />
        </el-select>
        <!-- 单选 -->
        <el-radio-group v-if="item.type==='Radio'" v-model="searchData[item.prop]" @change="item.handle()">
          <el-radio v-for="ra in item.datas" :key="ra.item_code" :label="ra.item_code" style="disabled:true;">{{ ra.item_text }}</el-radio>
        </el-radio-group>
        <!-- 单选按钮 -->
        <el-radio-group v-if="item.type==='RadioButton'" v-model="searchData[item.prop]">
          <el-radio-button v-for="ra in item.datas" :key="ra.item_code" :label="ra.item_code">{{ ra.item_text }}</el-radio-button>
        </el-radio-group>
        <!-- 复选框 -->
        <el-checkbox-group v-if="item.type==='Checkbox'" v-model="searchData[item.prop]">
          <el-checkbox v-for="ch in item.datas" :key="ch.item_code" :label="ch.item_code">{{ ch.item_text }}</el-checkbox>
        </el-checkbox-group>
        <!-- 日期 -->
        <el-date-picker v-if="item.type==='Date'" v-model="searchData[item.prop]" />
        <!-- 时间 -->
        <el-time-select v-if="item.type==='Time'" v-model="searchData[item.prop]" type="" />
        <!-- 日期时间 -->
        <el-date-picker v-if="item.type==='DateTime'" v-model="searchData[item.prop]" type="datetime" :disabled="item.disable && item.disable(searchData[item.prop])" />
        <!-- 滑块 -->
        <!-- <el-slider v-if="item.type==='Slider'" v-model="searchData[item.prop]"></el-slider> -->
        <!-- 开关 -->
        <el-switch v-if="item.type==='Switch'" v-model="searchData[item.prop]" />

      </el-form-item>
    </el-form>
    <el-form v-if="isHandle" inline>
      <el-form-item v-for="item in searchHandle" :key="item.prop" :label="item.type=='Input'?item.label:''" style="margin-left:20px;vertical-align: middle;">
        <el-input v-if="item.type==='Input'" v-model="searchData[item.prop]" size="mini" :placeholder="item.placeholder" />
        <el-button v-if="item.type!='Input'" :type="item.type" plain :size="item.size || size" @click="item.handle()">{{ item.label }}</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    isHandle: {
      type: Boolean,
      default: true
    },
    size: {
      type: String,
      default: 'mini'
    },
    searchForm: {
      type: Array,
      default: []
    },
    searchHandle: {
      type: Array,
      default: () => []
    },
    searchData: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
    }
  },
  methods: {
  }
}

</script>
<style>
</style>
